# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse

# Note: split1训练的模型,
# 用split2测试的正确率高是因为split2测试集都在split1训练集中出现过
parser = argparse.ArgumentParser(
    description=u"计数测试集样本在训练集样本中出现的比例")
parser.add_argument('--test-list', type=str,
                    default='./data/datalists/ucf101_split2_test.txt',
                    help=u'测试集split')
parser.add_argument('--train-list', type=str,
                    default='./data/datalists/ucf101_split1_train.txt',
                    help=u'测试集split')

args = parser.parse_args()

cnt = 0
summ = 0

test_list = []
with open(args.test_list, 'r') as f:
    for line in f:
        summ += 1
        v, _, _ = line.strip().split()
        test_list.append(v)

train_list = []
with open(args.train_list, 'r') as f:
    for line in f:
        v, _, _ = line.strip().split()
        train_list.append(v)

for i in test_list:
    for j in train_list:
        if i == j:
            cnt += 1
            break

# python2 输出元组
print(cnt, '/', summ)
